using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.MediaCenter.UI;
using Microsoft.MediaCenter.Hosting;
using Level65.WMVHelper;
using Level65.ClipShow;

namespace ClipShow
{
    public class ChannelTextBox : CoreUICodeBehind
    {
        private ClipCollection _mediaChannel;
        private Choice _myChosenContentItems;
        public ChannelTextBox()
        {
        }

        #region Public properties
        public ClipCollection SourceChannel
        {
            set { _mediaChannel = value;}
            get { return (_mediaChannel); }
        }
        public Choice ChannelItems
        {
            get { return (_myChosenContentItems); }
            set { _myChosenContentItems = value; }
        }
        public MediaPlayCodeBehind ResultPageWithChannel
        {
            get
            {
                MediaPlayCodeBehind cb = new MediaPlayCodeBehind();
                cb.CreateChannel(this._mediaChannel, this._myChosenContentItems);
                cb.CurrentChannel = this._mediaChannel;
                cb.PlayClip();
                return (cb);
            }
        }
        #endregion

        public void SaveChannel()
        {
            Storage st = new Storage();
            st.PersistChannel(_mediaChannel, this.AppSettings.CreateAsx);
        }

    }
}
